home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Languguage OS 2
/
Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO
/
a_utils
/
_archvrs
/
amiga
/
pplib.lzh
/
PPLib
/
oberoninterface
/
PowerPacker.mod
< prev
next >
Wrap
Text File
|
1991-10-30
|
4KB
|
96 lines
MODULE PowerPacker;
(*
** Filename: libraries/ppbase.h
** Release: 1.3
**
** (C) Copyright 1991 Nico Franτois
** All Rights Reserved
*)
IMPORT
s: SYSTEM, e: Exec, I: Intuition;
CONST
PPName* = "powerpacker.library";
PPVersion* = 35;
(* decrunch colors for LoadData and DecrunchBuffer *)
DecrCol0* = 0;
DecrCol1* = 1;
DecrPoint* = 2;
DecrScrol* = 3;
DecrNone* = 4;
(* error codes returned by LoadData *)
LoadOk* = 0;
OpenErr* = -1;
ReadErr* = -2;
NoMemory* = -3;
Crypted* = -4;
PassErr* = -5;
UnknownPP* = -6;
(* size of speedup buffer *)
SpeedupBuffLarge* = 0;
SpeedupBuffMedium* = 1;
SpeedupBuffSmall* = 2;
(* crunching efficiency *)
CrunFast* = 0;
CrunMediocre* = 1;
CrunGood* = 2;
CrunVeryGood* = 3;
CrunBest* = 4;
(* possible return values from ppCrunchBuffer() *)
CrunchAborted = 0;
BufferOverflow = -1;
TYPE
PPBase* = STRUCT
LibNode* : e.Library;
flags* : SHORTSET;
pad* : SHORTINT;
segList* : LONGINT; (* BPTR *)
END; (* STRUCT *)
PPBasePtr* = POINTER TO PPBase;
PassFunc* = PROCEDURE (checksum: INTEGER; password: e.ADDRESS): BOOLEAN;
(** Must be of type "DeallocPars" and "SaveAllRegs" !! **)
PercFunc* = PROCEDURE (lensofar: LONGINT; crunlen: LONGINT;
totlen: LONGINT; userdata: e.ADDRESS): BOOLEAN;
(** Must be of type "DeallocPars" and "SaveAllRegs" !! **)
VAR
pp* : PPBasePtr;
PROCEDURE LoadData* {pp, -30} (filename{8}: ARRAY OF CHAR; col{0}: LONGINT;
memtype{1}: LONGSET; VAR buffer{9}: e.ADDRESS;
VAR len{10}: LONGINT; func{11}: PassFunc)
: LONGINT;
PROCEDURE DecrunchBuffer* {pp, -36} (endcrun{8}, decrbuf{9}, effptr{10}: e.ADDRESS;
col{0}: LONGINT);
PROCEDURE CalcCheckSum* {pp, -42} (string{8}: ARRAY OF CHAR): INTEGER;
PROCEDURE CalcPasskey* {pp, -48} (password{8}: ARRAY OF CHAR): LONGINT;
PROCEDURE Decrypt* {pp, -54} (buffer{8}: e.ADDRESS; len{0}, key{1}: LONGINT);
PROCEDURE GetPassword* {pp, -60} (screen{8}: I.ScreenPtr; buffer{9}: e.ADDRESS;
maxchars{0}: LONGINT; checksum{1}: INTEGER)
: BOOLEAN;
PROCEDURE AllocCrunchInfo {pp, -96} (eff{0}: LONGINT; speedup{1}: LONGINT;
func{8}: PercFunc; userdata{9}: e.ADDRESS)
: e.ADDRESS;
PROCEDURE FreeCrunchInfo {pp, -102} (crunchinfo{8}: e.ADDRESS);
PROCEDURE CrunchBuffer {pp, -108} (crunchinfo{8}: e.ADDRESS; buffer{9}: e.ADDRESS;
len{0}: LONGINT) : LONGINT;
PROCEDURE WriteDataHeader {pp, -114} (lock{0}: LONGINT; eff{1}: LONGINT;
crypt{2}: BOOLEAN; checksum{3}: LONGINT)
: BOOLEAN;
PROCEDURE EnterPassword* {pp, -120} (screen{8}: I.ScreenPtr; buffer{9}: e.ADDRESS)
: BOOLEAN;
PROCEDURE ErrorMessage* {pp, -132} (error{0}: LONGINT): ARRAY OF CHAR;
BEGIN
pp := s.VAL (PPBasePtr, e.OpenLibrary (PPName, PPVersion));
IF pp = NIL THEN
IF I.DisplayAlert (0, "\x00\x64\x14missing powerpacker.library V35\o\o",
50) THEN END;
HALT (20)
END; (* IF *)
CLOSE
IF pp # NIL THEN
e.CloseLibrary (s.VAL (e.LibraryPtr, pp))
END; (* IF *)
END PowerPacker.